home *** CD-ROM | disk | FTP | other *** search
/ Enter 2003 July / EnterCD 7_2003.iso / Ekstra / GL Force 2001 3.0 / 3DFontView.h < prev    next >
Encoding:
C/C++ Source or Header  |  2002-03-19  |  3.3 KB  |  141 lines

  1. /*
  2. Authors: David Nishimoto
  3. Website: http://www.listensoftware.com
  4. Email: davepamn@relia.net
  5. Program: Force
  6. */
  7.  
  8. #if !defined(AFX_3DFONTVIEW_H__4431AE0D_2C62_11D3_955D_8422F5C00000__INCLUDED_)
  9. #define AFX_3DFONTVIEW_H__4431AE0D_2C62_11D3_955D_8422F5C00000__INCLUDED_
  10.  
  11. #if _MSC_VER >= 1000
  12. #pragma once
  13. #endif // _MSC_VER >= 1000
  14. #include <gl/gl.h>
  15. #include "GLFont.h"
  16.  
  17. typedef struct Camera
  18. {
  19. GLfloat m_x;
  20. GLfloat m_y;
  21. GLfloat    m_z;
  22.  
  23. GLfloat m_TranslationUnit;
  24. GLfloat m_radians;
  25. GLfloat m_height_y;
  26. }Camera;
  27.  
  28. typedef struct treenode
  29. {
  30.     GLfloat m[16];
  31.     char parent_key[30];
  32.     char node_key[30];
  33.     void (*f)();
  34.     void (*engine)();
  35.     struct treenode *sibling;
  36.     struct treenode *child;
  37.     struct treenode *most_recent_child;
  38. }treenode;
  39.  
  40.  
  41. class CMy3DFontView : public CView
  42. {
  43. protected: // create from serialization only
  44.     CMy3DFontView();
  45.     DECLARE_DYNCREATE(CMy3DFontView)
  46.  
  47. // Attributes
  48. public:
  49.     CMy3DFontDoc* GetDocument();
  50.  
  51. // Operations
  52. public:
  53.     Camera camera;
  54.     treenode *root;
  55.  
  56.     void drawWithOpenGL();
  57.     void setPerspectiveWindow(GLdouble fovy, GLdouble aspect,GLdouble zNear,GLdouble zFar);
  58.     void setViewport(GLint iX, GLint iY, GLsizei iWidth, GLsizei iHeight);
  59.     void setDepthBuffer();
  60.     void setSpeed();
  61.     void drawGrid();
  62.     void startGame();
  63.     void buildSceneGraph();
  64.     void BreakOutLeft();
  65.     void BreakOutRight();
  66.  
  67.     void traverseSceneGraph(treenode *root);
  68.     treenode * node(char *node_key);
  69.     void addChild(treenode *parentNode, treenode *childNode);
  70.     void cleanSceneGraph(treenode *root);
  71.     void setLighting();
  72.     void mushRoom_configuration();
  73.     int getMushRoomObjectCount(int type);
  74.     void drawMushRoomObjectList();
  75.     void setBlending();
  76.  
  77.     void bonus_configuration();
  78.     void buildBonusObject();
  79.     int getObjectCount(int type);
  80.     void drawBonusObjectList();
  81.     int getBonusObject();
  82.  
  83. // Overrides
  84.     // ClassWizard generated virtual function overrides
  85.     //{{AFX_VIRTUAL(CMy3DFontView)
  86.     public:
  87.     virtual void OnDraw(CDC* pDC);  // overridden to draw this view
  88.     virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
  89.     protected:
  90.     //}}AFX_VIRTUAL
  91.  
  92. // Implementation
  93. public:
  94.     virtual ~CMy3DFontView();
  95. #ifdef _DEBUG
  96.     virtual void AssertValid() const;
  97.     virtual void Dump(CDumpContext& dc) const;
  98. #endif
  99.  
  100. protected:
  101.  
  102.     
  103.     CPalette m_Palette; //the logic palette
  104.     HGLRC    m_hRC;
  105.     CDC*     m_pDC;
  106.  
  107.     CGLFont  m_FontX;
  108.  
  109.  
  110.     void InitPalette(void);
  111.     void DrawGLFont(void);
  112.     void InitFontColor(void);
  113.  
  114. // Generated message map functions
  115. protected:
  116.     //{{AFX_MSG(CMy3DFontView)
  117.     afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
  118.     afx_msg void OnDestroy();
  119.     afx_msg void OnSize(UINT nType, int cx, int cy);
  120.     afx_msg void OnTimer(UINT nIDEvent);
  121.     afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
  122.     afx_msg void OnFilePause();
  123.     afx_msg void OnFileNew();
  124.     afx_msg void OnFileResume();
  125.     afx_msg void OnAppAbout();
  126.     //}}AFX_MSG
  127.     DECLARE_MESSAGE_MAP()
  128. };
  129.  
  130. #ifndef _DEBUG  // debug version in 3DFontView.cpp
  131. inline CMy3DFontDoc* CMy3DFontView::GetDocument()
  132.    { return (CMy3DFontDoc*)m_pDocument; }
  133. #endif
  134.  
  135. /////////////////////////////////////////////////////////////////////////////
  136.  
  137. //{{AFX_INSERT_LOCATION}}
  138. // Microsoft Developer Studio will insert additional declarations immediately before the previous line.
  139.  
  140. #endif // !defined(AFX_3DFONTVIEW_H__4431AE0D_2C62_11D3_955D_8422F5C00000__INCLUDED_)
  141.